# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Thomas Weißschuh <thomas t-8ch de>
# Contributor: James Reed <supplantr at archlinux dot info>

pkgname=tcplay
pkgver=3.3
pkgrel=2
pkgdesc='Free and simple TrueCrypt implementation based on dm-crypt'
url='https://github.com/bwalex/tc-play'
arch=('loong64' 'x86_64')
license=('BSD')
depends=('glibc' 'device-mapper' 'util-linux-libs' 'libgcrypt' 'libuuid.so')
makedepends=('cmake' 'udev')
provides=('libtcplay.so')
source=(https://github.com/bwalex/tc-play/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('ad53cd814a23b4f61a1b2b6dc2539624ffb550504c400c45cbd8cd1da4c7d90a')
b2sums=('c02489d6e291dfc1425745af86506e72fda7f67dba0668b9250a85604ba301761b5bbbad6927238042a0f89da1035d9e3275006e34e895835a53cdc24974f419')

build() {
  mkdir -p tc-play-${pkgver}/build
  cd tc-play-${pkgver}/build
  # cmake is stupid
  export CFLAGS+=" ${CPPFLAGS}"
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIB_SUFFIX= \
    -DSBIN_DIR=bin ..
  make VERBOSE=1
}

package() {
  cd tc-play-${pkgver}
  make -C build DESTDIR="$pkgdir" install
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 CHANGELOG README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
